package com.zenchn.service;

import com.zenchn.entity.ReportStatisticsVO;
import com.zenchn.generic.GenericService;
import com.zenchn.model.TMiCustomer;
import com.zenchn.model.TMiCustomerExample;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wlf
 * @version 1.0
 * @date 2021/6/7 11:53:33
 */
public interface CustomerService extends GenericService<TMiCustomer, String, TMiCustomerExample> {

    /**
     * 检查重复客户 （名字）
     **/
    boolean checkExistCustomer(String customerName);


    /**
     * 代理商动态SQL查询不定多参数
     *
     * @param keyword
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param level
     * @param startDate
     * @param endDate
     * @return
     */
    List<TMiCustomer> selectAgentDynamicSqlByParameter(String keyword, List<String> areasCodeList, String areasCode, String accountId, Integer level, LocalDateTime startDate, LocalDateTime endDate);

    /**
     * 医院动态SQL查询不定多参数
     *
     * @param keyword
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param level
     * @param startDate
     * @param endDate
     * @return
     */
    List<TMiCustomer> selectHospitalDynamicSqlByParameter(String keyword, List<String> areasCodeList, String areasCode, String accountId, Integer level, LocalDateTime startDate, LocalDateTime endDate);

    /**
     * 获取本期新增客户数量
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @param startDate
     * @param endDate
     */
    List<ReportStatisticsVO> selectCurCustomerNum(List<String> areasCodeList, String areasCode, String accountId, String customerType, LocalDateTime startDate, LocalDateTime endDate);

    /**
     * 获取期末客户总数
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @param endDate
     * @return
     */
    List<ReportStatisticsVO> selectFinalCustomerAllNum(List<String> areasCodeList, String areasCode, String accountId, String customerType, LocalDateTime endDate);

    /**
     * 获取期末客户等级分布
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @param endDate
     * @return
     */
    List<ReportStatisticsVO> selectFinalCustomerLevelNum(List<String> areasCodeList, String areasCode, String accountId, String customerType, LocalDateTime endDate);

    /**
     * 最新客户等级分布
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @return
     */
    List<ReportStatisticsVO> selectNewCustomerLevelNum(List<String> areasCodeList, String areasCode, String accountId, String customerType);

    /**
     * 本期晋级数量
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @param startDate
     * @param endDate
     * @return
     */
    List<ReportStatisticsVO> selectCurCustomerUpgradeNum(List<String> areasCodeList, String areasCode, String accountId, String customerType, LocalDateTime startDate, LocalDateTime endDate);

    /**
     * 本期业绩完成情况
     *
     * @param areasCodeList
     * @param areasCode
     * @param accountId
     * @param customerType
     * @param startDate
     * @param endDate
     * @return
     */
    List<ReportStatisticsVO> selectCurCustomerFinishNum(List<String> areasCodeList, String areasCode, String accountId, String customerType, LocalDateTime startDate, LocalDateTime endDate);

}
